<?php

class AdminController extends Controller
{
	public function actionIndex()
	{
            $typeRuangan = TypeRuangan::model();
            if(isset($_GET["TypeRuangan"])) {
                $typeRuangan->attributes = $_GET["TypeRuangan"];
            }
            
            $building = Building::model();
            if(isset($_GET["Building"])) {
                $building->attributes = $_GET["Building"];
            }

            $this->render('index', array("typeRuangan" => $typeRuangan, "building" => $building));
	}

        public function actionGetAccordion() {
            echo $this->renderPartial("_buildingAccordion", array("model" => Building::model()), true);
        }

	// Uncomment the following methods and override them if needed
	/*
	public function filters()
	{
		// return the filter configuration for this controller, e.g.:
		return array(
			'inlineFilterName',
			array(
				'class'=>'path.to.FilterClass',
				'propertyName'=>'propertyValue',
			),
		);
	}

	public function actions()
	{
		// return external action classes, e.g.:
		return array(
			'action1'=>'path.to.ActionClass',
			'action2'=>array(
				'class'=>'path.to.AnotherActionClass',
				'propertyName'=>'propertyValue',
			),
		);
	}
	*/
}